Add lightweight system tracing option#2723
Open
nicomazz wants to merge 1 commit into
Open
Conversation
Enrich Lottie trace slices with composition source names (resource entry name or asset filename) for easier identification in Perfetto traces. Changes: - Thread sourceName from LottieCompositionFactory into LottieComposition for both raw resource and asset loading paths. - Cache and use dynamic trace names in LottieValueAnimator.doFrame() and playAnimation() using Lottie's L trace API. - Add setEnableLightTracing() builder API in LottieConfig to enable lightweight per-frame trace slices independently from the heavy setEnableSystraceMarkers option. This light tracing is safe to be always enabled in production with near zero performance overhead. Bug: 520507665 Bug: 431188311 Test: Build success Flag: EXEMPT DEBUG Change-Id: I0c98012a1c531aa15b1057b1b1abf50a1a6c64ef
0c63a1b to
038b75e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new lightweight tracing option (enableLightTracing) for Lottie, allowing developers to monitor all Lottie animators receiving per-frame callbacks in Perfetto traces with minimal performance overhead.
Context: In Android SystemUI, we recently encountered several Lottie-related performance issues where animations were unintentionally running indefinitely due to caller bugs. While Lottie already supports tracing, enabling the full suite of Lottie trace markers proved to be too heavy for continuous monitoring on lab and field devices.
By introducing this lightweight tracing alternative, we were successfully able to spot and fix multiple animation leaks in production without the severe overhead of the full tracing suite.
(Upstreamed from AOSP)